from rest_framework import serializers

from apps.works.models import Work, WorksList


class WorkSerializer(serializers.ModelSerializer):
    """作品序列化器类"""
    # create_time = serializers.DateTimeField(format='%Y-%m-%d %H:%M:%S')
    create_time = serializers.DateTimeField(format='%Y-%m-%d')

    class Meta:
        model = Work
        fields = '__all__'


class WorksListSerializer(serializers.ModelSerializer):
    """作品集序列化器类"""

    class Meta:
        model = WorksList
        fields = '__all__'

